package es.ikex.servlet;

import java.io.IOException;
import java.lang.ProcessBuilder.Redirect;
import java.util.Enumeration;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class BloquearUsuario extends HttpServlet {
	private static final long serialVersionUID = 1L;
       

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		Enumeration<String> parametros = request.getParameterNames();
		
		String where = "";
		do{
			String parametro = parametros.nextElement();
			if(request.getParameter(parametro) != null && request.getParameter(parametro) != "" && !parametro.equalsIgnoreCase("buscar")){
				where = where + " " + parametro + "='" + request.getParameter(parametro) + "' and ";
			}
			
		}while(parametros.hasMoreElements());
		
		if(!where.equals("")){
			where = " where " + where.substring(0, (where.length() - 5));
		}
		
		request.getRequestDispatcher("Admin/SuperAdmin/editarUsuario.jsp?where="+where).forward(request, response);
	}

}
